/**
 * 获得地址栏的某个参数
 * @param       {[type]} name [description]
 * @constructor
 */
export function getQueryString(name) {
  var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i')
  var r = window.location.search.substr(1).match(reg)
  if (r != null) return unescape(r[2])
  return null
}

export function validataWechat() {
  var ua = navigator.userAgent.toLowerCase()
  var isWeixin = ua.indexOf('micromessenger') !== -1
  if (isWeixin) {
    return true
  } else {
    return false
  }
}
